package com.datasure.types;

import lombok.Getter;

import javax.xml.bind.ValidationException;

/**
 * @author zhangxiaolong
 * @ClassName IntegerId.java
 * @Description Integer类型主键Id
 * @createTime 2022年01月14日 14:45:00
 */
@Getter
public class IntegerId implements Identifier{
    private final Integer id;

    public IntegerId(Integer id) throws ValidationException {
        if(id < 0){
            throw new ValidationException("id不能为负数");
        }
        this.id = id;
    }
}
